<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>解决 React-Native 在 Mac 下启动报 error code 65 - Lucklyの博客 - 在阅读中遇见自己</title>
    <meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>

<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">


<meta name="author" content="Luckly" /><meta name="description" content="React-Native 开发的项目，Android 方面没有任何问题，IOS 就是无法跑起来，报错信息如下：
1  error Failed to build iOS project. We ran &amp;#34;xcodebuild&amp;#34; command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening reactNative.xcodeproj   Mac 版本是 10.14.4 ，xcode 版本是 10.2.1
" /><meta name="keywords" content="Hugo, theme, even" />






<meta name="generator" content="Hugo 0.79.1 with even 4.0.0" />


<link rel="canonical" href="https://luckly.work/2019/04/%E8%A7%A3%E5%86%B3-react-native-%E5%9C%A8-mac-%E4%B8%8B%E5%90%AF%E5%8A%A8%E6%8A%A5-error-code-65/" />
<link href="/2019/04/%E8%A7%A3%E5%86%B3-react-native-%E5%9C%A8-mac-%E4%B8%8B%E5%90%AF%E5%8A%A8%E6%8A%A5-error-code-65/" rel="alternate" type="application/rss+xml" title="Lucklyの博客 - 在阅读中遇见自己" />
<link href="/2019/04/%E8%A7%A3%E5%86%B3-react-native-%E5%9C%A8-mac-%E4%B8%8B%E5%90%AF%E5%8A%A8%E6%8A%A5-error-code-65/" rel="feed" type="application/rss+xml" title="Lucklyの博客 - 在阅读中遇见自己" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">

<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<link href="/dist/even.06658218.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.css" integrity="sha256-7TyXnr2YU040zfSP+rEcz29ggW4j56/ujTPwjMzyqFY=" crossorigin="anonymous">
<link rel="stylesheet" href="/css/reset-even.css">


<meta property="og:title" content="解决 React-Native 在 Mac 下启动报 error code 65" />
<meta property="og:description" content="React-Native 开发的项目，Android 方面没有任何问题，IOS 就是无法跑起来，报错信息如下：


1


error Failed to build iOS project. We ran &#34;xcodebuild&#34; command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening reactNative.xcodeproj


Mac 版本是 10.14.4 ，xcode 版本是 10.2.1" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://luckly.work/2019/04/%E8%A7%A3%E5%86%B3-react-native-%E5%9C%A8-mac-%E4%B8%8B%E5%90%AF%E5%8A%A8%E6%8A%A5-error-code-65/" />
<meta property="article:published_time" content="2019-04-21T16:55:06+08:00" />
<meta property="article:modified_time" content="2019-04-21T16:55:06+08:00" />
<meta itemprop="name" content="解决 React-Native 在 Mac 下启动报 error code 65">
<meta itemprop="description" content="React-Native 开发的项目，Android 方面没有任何问题，IOS 就是无法跑起来，报错信息如下：


1


error Failed to build iOS project. We ran &#34;xcodebuild&#34; command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening reactNative.xcodeproj


Mac 版本是 10.14.4 ，xcode 版本是 10.2.1">
<meta itemprop="datePublished" content="2019-04-21T16:55:06+08:00" />
<meta itemprop="dateModified" content="2019-04-21T16:55:06+08:00" />
<meta itemprop="wordCount" content="444">



<meta itemprop="keywords" content="React-Native," />
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="解决 React-Native 在 Mac 下启动报 error code 65"/>
<meta name="twitter:description" content="React-Native 开发的项目，Android 方面没有任何问题，IOS 就是无法跑起来，报错信息如下：


1


error Failed to build iOS project. We ran &#34;xcodebuild&#34; command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening reactNative.xcodeproj


Mac 版本是 10.14.4 ，xcode 版本是 10.2.1"/>

</head>
<body>
<div id="mobile-navbar" class="mobile-navbar">
    <div class="mobile-header-logo">
        <a href="/" class="logo">遇见</a>
    </div>
    <div class="mobile-navbar-icon">
        <span></span>
        <span></span>
        <span></span>
    </div>
</div>
<nav id="mobile-menu" class="mobile-menu slideout-menu">
    <ul class="mobile-menu-list">
        <a href="/">
            <li class="mobile-menu-item" title="首页">首页</li>
        </a>
        <a href="/post/">
            <li class="mobile-menu-item" title="归档">归档</li>
        </a>
        <a href="/categories/">
            <li class="mobile-menu-item" title="分类">分类</li>
        </a>
        <a href="/tags/">
            <li class="mobile-menu-item" title="标签">标签</li>
        </a>
        <a href="/about/">
            <li class="mobile-menu-item" title="关于我">关于我</li>
        </a>
        <a href="/friend/">
            <li class="mobile-menu-item" title="友链">友链</li>
        </a>
        <a href="https://github.com/ITmxs/">
            <li class="mobile-menu-item" title="阅读清单">阅读清单</li>
        </a>
        
    </ul>
    <form class="search-form" style="position: absolute;">
    <input name="search" type="search" style="height: 28px;padding-left: 30px;"/>
    <input type="image" src="/img/search.svg" alt="Search" style="position: absolute;left: 6px;top: 6px;"/>
</form>


</nav>

<div class="container" id="mobile-panel">
    <header id="header" class="header">
        <div class="logo-wrapper">
  <a href="/%20/" class="logo">遇见</a>
</div>

<nav class="site-navbar">
  <ul id="menu" class="menu">
    <li class="menu-item">
      <a class="menu-item-link" href="/">首页</a>
    </li><li class="menu-item">
      <a class="menu-item-link" href="/post/">归档</a>
    </li><li class="menu-item">
      <a class="menu-item-link" href="/categories/">分类</a>
    </li><li class="menu-item">
      <a class="menu-item-link" href="/tags/">标签</a>
    </li><li class="menu-item">
      <a class="menu-item-link" href="/about/">关于我</a>
    </li><li class="menu-item">
      <a class="menu-item-link" href="/friend/">友链</a>
    </li><li class="menu-item">
      <a class="menu-item-link" href="https://github.com/ITmxs/">阅读清单</a>
    </li>
  </ul>
</nav>
        <form class="search-form" style="position: absolute;">
    <input name="search" type="search" style="height: 28px;padding-left: 30px;"/>
    <input type="image" src="/img/search.svg" alt="Search" style="position: absolute;left: 6px;top: 6px;"/>
</form>



    </header>


    <main id="main" class="main">
        <div class="content-wrapper">
            <div id="content" class="content">
                <article class="post">
  
  <header class="post-header">
    <h1 class="post-title">解决 React-Native 在 Mac 下启动报 error code 65</h1>

    <div class="post-meta">
      <span class="post-time"> 2019-04-21 </span>
      <div class="post-category">
        <a href="/categories/%E6%8A%80%E6%9C%AF/"> 技术 </a>
        </div>
      <span class="more-meta"> 约 444 字 </span>
      <span class="more-meta"> 预计阅读 1 分钟 </span>
      <span id="busuanzi_container_page_pv" class="more-meta"> <span id="busuanzi_value_page_pv"><img src="/img/spinner.svg" alt="spinner.svg"/></span> 次阅读 </span>
    </div>
  </header>

  <div class="post-toc" id="post-toc">
  <h2 class="post-toc-title">文章目录</h2>
  <div class="post-toc-content">
    <nav id="TableOfContents">
  <ul>
    <li>
      <ul>
        <li><a href="#解决方法">解决方法</a></li>
        <li><a href="#解决-ios-运行依赖下载缓慢的问题">解决 IOS 运行依赖下载缓慢的问题</a></li>
        <li><a href="#参考">参考</a></li>
      </ul>
    </li>
  </ul>
</nav>
  </div>
</div>
  <div class="post-content">
    <p>React-Native 开发的项目，Android 方面没有任何问题，IOS 就是无法跑起来，报错信息如下：</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-bash" data-lang="bash">error Failed to build iOS project. We ran <span class="s2">&#34;xcodebuild&#34;</span> <span class="nb">command</span> but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening reactNative.xcodeproj
</code></pre></td></tr></table>
</div>
</div><p>Mac 版本是 10.14.4 ，xcode 版本是 10.2.1</p>
<h2 id="解决方法">解决方法</h2>
<ol>
<li>删除项目依赖包以及 yarn 缓存</li>
</ol>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-bash" data-lang="bash">rm -rf node_modules <span class="o">&amp;&amp;</span> yarn cache clean
</code></pre></td></tr></table>
</div>
</div><ol>
<li>重新装包</li>
</ol>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-bash" data-lang="bash">yarn install
</code></pre></td></tr></table>
</div>
</div><ol>
<li>清除 React-Native 缓存</li>
</ol>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-bash" data-lang="bash">rm -rf ~/.rncache
</code></pre></td></tr></table>
</div>
</div><ol>
<li>下载 React-Native IOS 运行依赖</li>
</ol>
<p>直接运行下载脚本，若直接下载完成，后面的步骤就不用看了，直接运行项目 <code>react-native run-ios</code> 即可</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-bash" data-lang="bash">node_modules/react-native/scripts/ios-install-third-party.sh
</code></pre></td></tr></table>
</div>
</div><h2 id="解决-ios-运行依赖下载缓慢的问题">解决 IOS 运行依赖下载缓慢的问题</h2>
<p>国内下载是相当的慢，这时候就要合理使用下载工具了。我使用的是 <a href="https://github.com/proxyee-down-org/proxyee-down">proxy-down</a>,开源下载工具，可以配置代理。</p>
<p>查看要下载的文件</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-bash" data-lang="bash">cat node_modules/react-native/scripts/ios-install-third-party.sh
</code></pre></td></tr></table>
</div>
</div><p>输出如下</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span><span class="lnt">6
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-bash" data-lang="bash"><span class="cp">#!/bin/bash
</span><span class="cp"></span><span class="c1"># 多余的东西不显示</span>
fetch_and_unpack glog-0.3.5.tar.gz https://github.com/google/glog/archive/v0.3.5.tar.gz 61067502c5f9769d111ea1ee3f74e6ddf0a5f9cc <span class="s2">&#34;\&#34;</span><span class="nv">$SCRIPTDIR</span><span class="s2">/ios-configure-glog.sh\&#34;&#34;</span>
fetch_and_unpack double-conversion-1.1.6.tar.gz https://github.com/google/double-conversion/archive/v1.1.6.tar.gz 1c7d88afde3aaeb97bb652776c627b49e132e8e0
fetch_and_unpack boost_1_63_0.tar.gz https://github.com/react-native-community/boost-for-react-native/releases/download/v1.63.0-0/boost_1_63_0.tar.gz c3f57e1d22a995e608983effbb752b54b6eab741
fetch_and_unpack folly-2018.10.22.00.tar.gz https://github.com/facebook/folly/archive/v2018.10.22.00.tar.gz f70a75bfeb394363d2049a846bba118ffb3b368a
</code></pre></td></tr></table>
</div>
</div><p>四个下载链接是关键，使用工具下载这四个文件。<strong>下载链接与 React-Native 版本紧密关联，请仔细查看文件版本。</strong></p>
<ol>
<li><a href="https://github.com/google/glog/archive/v0.3.5.tar.gz">https://github.com/google/glog/archive/v0.3.5.tar.gz</a></li>
<li><a href="https://github.com/google/double-conversion/archive/v1.1.6.tar.gz">https://github.com/google/double-conversion/archive/v1.1.6.tar.gz</a></li>
<li><a href="https://github.com/react-native-community/boost-for-react-native/releases/download/v1.63.0-0/boost_1_63_0.tar.gz">https://github.com/react-native-community/boost-for-react-native/releases/download/v1.63.0-0/boost_1_63_0.tar.gz</a></li>
<li><a href="https://github.com/facebook/folly/archive/v2018.10.22.00.tar.gz">https://github.com/facebook/folly/archive/v2018.10.22.00.tar.gz</a></li>
</ol>
<p>下载完成后，新建文件夹 <strong>.rncache</strong>，将下载的四个文件移入到目录下</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-bash" data-lang="bash">mkdir ~/.rncache
</code></pre></td></tr></table>
</div>
</div><p>再次运行安装脚本，因为使用本地下载文件，所有运行起来很快。</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-bash" data-lang="bash">node_modules/react-native/scripts/ios-install-third-party.sh
</code></pre></td></tr></table>
</div>
</div><p>运行项目就可以跑起来了，首次启动会有点慢，耐心等会就行。</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-bash" data-lang="bash">react-native run-ios
</code></pre></td></tr></table>
</div>
</div><h2 id="参考">参考</h2>
<ol>
<li><a href="https://github.com/facebook/react-native/issues/20774">https://github.com/facebook/react-native/issues/20774</a></li>
</ol>
  </div>

  <div class="post-copyright">
  <p class="copyright-item">
    <span class="item-title">文章作者</span>
    <span class="item-content">Luckly</span>
  </p>
  <p class="copyright-item">
    <span class="item-title">上次更新</span>
    <span class="item-content">
        2019-04-21
        
    </span>
  </p>
  
  
</div>
<footer class="post-footer">
    <div class="post-tags">
      <a href="/tags/react-native/">React-Native</a>
      </div>
    <nav class="post-nav">
      <a class="prev" href="/2019/04/react-%E4%B8%8E-react-native-%E4%BD%BF%E7%94%A8%E5%90%8C%E4%B8%80%E4%B8%AA-meteor-%E5%90%8E%E5%8F%B0/">
        <i class="iconfont icon-left"></i>
        <span class="prev-text nav-default">React 与 React-Native 使用同一个 meteor 后台</span>
        <span class="prev-text nav-mobile">上一篇</span>
      </a>
      <a class="next" href="/2019/04/%E4%B8%80%E8%A1%8C%E5%91%BD%E4%BB%A4%E6%9B%B4%E6%96%B0%E6%89%80%E6%9C%89-npm-%E4%BE%9D%E8%B5%96%E5%8C%85/">
        <span class="next-text nav-default">一行命令更新所有 npm 依赖包</span>
        <span class="next-text nav-mobile">下一篇</span>
        <i class="iconfont icon-right"></i>
      </a>
    </nav>
  </footer>
  
</article>
            </div>
            

        </div>
    </main>

    <footer id="footer" class="footer">
        <div class="social-links">
  <a href="852851198@qq.com" class="iconfont icon-email" title="email" rel="noopener" target="_blank" data-title="email"> </a>
  <a href="https://github.com/ITmxs" class="iconfont icon-github" title="github" rel="noopener" target="_blank" data-title="github"> </a>
  <a href="https://juejin.cn/user/3843548384077192" class="iconfont icon-juejin" title="juejin" rel="noopener" target="_blank" data-title="juejin"> </a>
  <a href="https://www.zhihu.com/people/yimi-yang-guang-96-65" class="iconfont icon-zhihu" title="zhihu" rel="noopener" target="_blank" data-title="zhihu"> </a>
  <a href="https://space.bilibili.com/480883651" class="iconfont icon-bilibili" title="bilibili" rel="noopener" target="_blank" data-title="bilibili"> </a>
  <a href="https://luckly.work/index.xml" type="application/rss+xml" rel="noopener" target="_blank" class="iconfont icon-rss" title="rss"></a>


</div>

<div class="copyright">
  <span class="power-by">
    由 <a class="hexo-link" href="https://gohugo.io">Hugo</a> 强力驱动
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    主题 -
    <a class="theme-link" href="https://github.com/olOwOlo/hugo-theme-even">Even</a>
  </span>

  <div class="busuanzi-footer">
    <span id="busuanzi_container_site_pv"> 本站总访问量 <span id="busuanzi_value_site_pv"><img src="/img/spinner.svg" alt="spinner.svg"/></span> 次 </span>
    <span class="division">|</span>
    <span id="busuanzi_container_site_uv"> 本站总访客数 <span id="busuanzi_value_site_uv"><img src="/img/spinner.svg" alt="spinner.svg"/></span> 人 </span>
  </div>

  <span class="copyright-year">
    &copy;
    2020 -
    2021
    <span class="heart">
      <i class="iconfont icon-heart"></i>
    </span>
    <span class="author">Luckly</span>
  </span>
</div>

    </footer>

    <div class="back-to-top" id="back-to-top">
        <i class="iconfont icon-up"></i>
    </div>
</div>
<script src="/lib/highlight/highlight.pack.js?v=20171001"></script>
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/slideout@1.0.1/dist/slideout.min.js" integrity="sha256-t+zJ/g8/KXIJMjSVQdnibt4dlaDxc9zXr/9oNPeWqdg=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.js" integrity="sha256-XVLffZaxoWfGUEbdzuLi7pwaUJv1cecsQJQqGLe7axY=" crossorigin="anonymous"></script>
<script type="text/javascript" src="/dist/even.47f727f4.min.js"></script>








</body>
</html>
